import configparser
import os


def get_config(section, key):
    try:
        config = configparser.ConfigParser()
        path = os.path.split(os.path.realpath(__file__))[0] + '/value.conf'
        config.read(path)
        return config.get(section, key)
    except configparser.NoOptionError:
        print("配置文件中不存在key为{key}的值".format(key=key))
        return None
